Started pref refactor, added javadocs