Eliminated redundant code in UserController