outsource moduleGenerator to lib