preferences page small refactoring