mega refactoring