Changed implementation of controller to improve clarity.
Deleted unrequired files.