fixed refactor