Refactored codes in controller and ui changed ui's to abstracts and separated them with the controller