codebase refactoring