refactor: use a subgenerator to create common files