fixed refactoring mistakes