refactored generator requiring