1.added PreferenceManager
2.trying to simplify dialog process