refactoring error