Refactored core Controller. Now it is inherited by controllerclass