Changed layout of controller

made the controller more modular and added the controller files to a
controller folder.