Refactored the preferences fetching to make it significantly less retarded.