Moved logic from advisors/views/preferences into the models file.