Clean code for DialogPreference