Removed excess code from  controller