Cleanup and Refactor