refactoring profilcontroller