Cleanup and Refactoring