fixed refactor mistake, removed some unnecessary lines