creates set_user method in controllers for refactoring