Moved some logging statements out of the controller code