Refactoring error