Bad refactoring fixed