refactor getEdit and putEdit methods on the UserController