fixed wrong refactoring