fixed bad refactor