project cleanup and refactoring