implementation of hapi subgenerator