Fixed faulty refactor