Refactored Code to create separate classes.
Cleanup code.