Started Refactoring and Code Cleaning