Fixed error in refactoring