refactoring controller
moved Controller so shared