Code Cleanup
* Refactored and cleaned up code