fixed refactoring