bloody refactoring