preferences refactor