diff --git a/src/com/bliss/support/preferences/GlobalSettingSwitchPreference.java b/src/com/bliss/support/preferences/GlobalSettingSwitchPreference.java
index 81ec92f..34f6666 100644
--- a/src/com/bliss/support/preferences/GlobalSettingSwitchPreference.java
+++ b/src/com/bliss/support/preferences/GlobalSettingSwitchPreference.java
@@ -20,7 +20,7 @@
 import android.os.UserHandle;
 import android.util.AttributeSet;
 
-import lineageos.preference.SelfRemovingSwitchPreference;
+import com.bliss.support.preferences.SelfRemovingSwitchPreference;
 
 public class GlobalSettingSwitchPreference extends SelfRemovingSwitchPreference {
 
diff --git a/src/com/bliss/support/preferences/LineageSecureSettingSeekBarPreference.java b/src/com/bliss/support/preferences/LineageSecureSettingSeekBarPreference.java
deleted file mode 100644
index a47575f..0000000
--- a/src/com/bliss/support/preferences/LineageSecureSettingSeekBarPreference.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2016-2019 crDroid Android Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.bliss.support.preferences;
-
-import android.content.Context;
-import android.util.AttributeSet;
-
-public class LineageSecureSettingSeekBarPreference extends CustomSeekBarPreference {
-
-    public LineageSecureSettingSeekBarPreference(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        setPreferenceDataStore(new LineageSecureSettingsStore(context.getContentResolver()));
-    }
-
-    public LineageSecureSettingSeekBarPreference(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        setPreferenceDataStore(new LineageSecureSettingsStore(context.getContentResolver()));
-    }
-
-    public LineageSecureSettingSeekBarPreference(Context context) {
-        super(context, null);
-        setPreferenceDataStore(new LineageSecureSettingsStore(context.getContentResolver()));
-    }
-}
diff --git a/src/com/bliss/support/preferences/LineageSecureSettingsStore.java b/src/com/bliss/support/preferences/LineageSecureSettingsStore.java
deleted file mode 100644
index a0819b4..0000000
--- a/src/com/bliss/support/preferences/LineageSecureSettingsStore.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2016-2019 crDroid Android Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.bliss.support.preferences;
-
-import android.content.ContentResolver;
-import android.preference.PreferenceDataStore;
-import android.os.UserHandle;
-
-import lineageos.providers.LineageSettings;
-
-
-public class LineageSecureSettingsStore extends androidx.preference.PreferenceDataStore
-        implements PreferenceDataStore {
-
-    private ContentResolver mContentResolver;
-
-    public LineageSecureSettingsStore(ContentResolver contentResolver) {
-        mContentResolver = contentResolver;
-    }
-
-    public boolean getBoolean(String key, boolean defValue) {
-        return LineageSettings.Secure.getIntForUser(mContentResolver, key, defValue ? 1 : 0, UserHandle.USER_CURRENT) != 0;
-    }
-
-    public float getFloat(String key, float defValue) {
-        return LineageSettings.Secure.getFloatForUser(mContentResolver, key, defValue, UserHandle.USER_CURRENT);
-    }
-
-    public int getInt(String key, int defValue) {
-        return LineageSettings.Secure.getIntForUser(mContentResolver, key, defValue, UserHandle.USER_CURRENT);
-    }
-
-    public long getLong(String key, long defValue) {
-        return LineageSettings.Secure.getLongForUser(mContentResolver, key, defValue, UserHandle.USER_CURRENT);
-    }
-
-    public String getString(String key, String defValue) {
-        String result = LineageSettings.Secure.getString(mContentResolver, key);
-        return result == null ? defValue : result;
-    }
-
-    public void putBoolean(String key, boolean value) {
-        putInt(key, value ? 1 : 0);
-    }
-
-    public void putFloat(String key, float value) {
-        LineageSettings.Secure.putFloatForUser(mContentResolver, key, value, UserHandle.USER_CURRENT);
-    }
-
-    public void putInt(String key, int value) {
-        LineageSettings.Secure.putIntForUser(mContentResolver, key, value, UserHandle.USER_CURRENT);
-    }
-
-    public void putLong(String key, long value) {
-        LineageSettings.Secure.putLongForUser(mContentResolver, key, value, UserHandle.USER_CURRENT);
-    }
-
-    public void putString(String key, String value) {
-        LineageSettings.Secure.putString(mContentResolver, key, value);
-    }
-}
diff --git a/src/com/bliss/support/preferences/LineageSystemSettingSeekBarPreference.java b/src/com/bliss/support/preferences/LineageSystemSettingSeekBarPreference.java
deleted file mode 100644
index 18ff1bc..0000000
--- a/src/com/bliss/support/preferences/LineageSystemSettingSeekBarPreference.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2016-2019 crDroid Android Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.bliss.support.preferences;
-
-import android.content.Context;
-import android.util.AttributeSet;
-
-public class LineageSystemSettingSeekBarPreference extends CustomSeekBarPreference {
-
-    public LineageSystemSettingSeekBarPreference(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        setPreferenceDataStore(new LineageSystemSettingsStore(context.getContentResolver()));
-    }
-
-    public LineageSystemSettingSeekBarPreference(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        setPreferenceDataStore(new LineageSystemSettingsStore(context.getContentResolver()));
-    }
-
-    public LineageSystemSettingSeekBarPreference(Context context) {
-        super(context, null);
-        setPreferenceDataStore(new LineageSystemSettingsStore(context.getContentResolver()));
-    }
-}
diff --git a/src/com/bliss/support/preferences/LineageSystemSettingsStore.java b/src/com/bliss/support/preferences/LineageSystemSettingsStore.java
deleted file mode 100644
index 02d52ab..0000000
--- a/src/com/bliss/support/preferences/LineageSystemSettingsStore.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2016-2019 crDroid Android Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.bliss.support.preferences;
-
-import android.content.ContentResolver;
-import android.preference.PreferenceDataStore;
-import android.os.UserHandle;
-
-import lineageos.providers.LineageSettings;
-
-
-public class LineageSystemSettingsStore extends androidx.preference.PreferenceDataStore
-        implements PreferenceDataStore {
-
-    private ContentResolver mContentResolver;
-
-    public LineageSystemSettingsStore(ContentResolver contentResolver) {
-        mContentResolver = contentResolver;
-    }
-
-    public boolean getBoolean(String key, boolean defValue) {
-        return LineageSettings.System.getIntForUser(mContentResolver, key, defValue ? 1 : 0, UserHandle.USER_CURRENT) != 0;
-    }
-
-    public float getFloat(String key, float defValue) {
-        return LineageSettings.System.getFloatForUser(mContentResolver, key, defValue, UserHandle.USER_CURRENT);
-    }
-
-    public int getInt(String key, int defValue) {
-        return LineageSettings.System.getIntForUser(mContentResolver, key, defValue, UserHandle.USER_CURRENT);
-    }
-
-    public long getLong(String key, long defValue) {
-        return LineageSettings.System.getLongForUser(mContentResolver, key, defValue, UserHandle.USER_CURRENT);
-    }
-
-    public String getString(String key, String defValue) {
-        String result = LineageSettings.System.getString(mContentResolver, key);
-        return result == null ? defValue : result;
-    }
-
-    public void putBoolean(String key, boolean value) {
-        putInt(key, value ? 1 : 0);
-    }
-
-    public void putFloat(String key, float value) {
-        LineageSettings.System.putFloatForUser(mContentResolver, key, value, UserHandle.USER_CURRENT);
-    }
-
-    public void putInt(String key, int value) {
-        LineageSettings.System.putIntForUser(mContentResolver, key, value, UserHandle.USER_CURRENT);
-    }
-
-    public void putLong(String key, long value) {
-        LineageSettings.System.putLongForUser(mContentResolver, key, value, UserHandle.USER_CURRENT);
-    }
-
-    public void putString(String key, String value) {
-        LineageSettings.System.putString(mContentResolver, key, value);
-    }
-}
diff --git a/src/com/bliss/support/preferences/SecureSettingSwitchPreference.java b/src/com/bliss/support/preferences/SecureSettingSwitchPreference.java
index a488e04..a0af4ed 100644
--- a/src/com/bliss/support/preferences/SecureSettingSwitchPreference.java
+++ b/src/com/bliss/support/preferences/SecureSettingSwitchPreference.java
@@ -22,7 +22,7 @@
 import android.os.UserHandle;
 import android.util.AttributeSet;
 
-import lineageos.preference.SelfRemovingSwitchPreference;
+import com.bliss.support.preferences.SelfRemovingSwitchPreference;
 
 public class SecureSettingSwitchPreference extends SelfRemovingSwitchPreference {
 
diff --git a/src/com/bliss/support/preferences/SystemSettingSwitchPreference.java b/src/com/bliss/support/preferences/SystemSettingSwitchPreference.java
index 8224f80..3a082f6 100644
--- a/src/com/bliss/support/preferences/SystemSettingSwitchPreference.java
+++ b/src/com/bliss/support/preferences/SystemSettingSwitchPreference.java
@@ -22,7 +22,7 @@
 import android.os.UserHandle;
 import android.util.AttributeSet;
 
-import lineageos.preference.SelfRemovingSwitchPreference;
+import com.bliss.support.preferences.SelfRemovingSwitchPreference;
 
 public class SystemSettingSwitchPreference extends SelfRemovingSwitchPreference {
 
