Fixed incomplete refactoring