project refactoring and cleanup