Redundant code in profile controller