fix bad refactor