Refactor preferences menu.