fixed incomplete refactoring