Refactor controller method to reduce complexity

Move controller method onto User model.