Refactored some code in the main controller and get rid of beanutils