refactor require