simplified the controller