Removed unused files.
Refactored some of the code