Refactor controllers with User factory.