Refactor subgenerators