Refactoring
Fixed error in previous refactoring