Fixed bad refactoring