refactored code to accomodate multiple file generators