Massive changes to handle categories, prefs