Isolate some codegen into architecture independent area. This should make adding new generators easier.