Code Clean up on the controller