fix the refactor