hardcore refactoring