Refactoring debbugged