refactor: use a subgenerator to create common files
Closes #17