refactor preferences