> Yes, I had failed to see the proper solution: a class generator
Looks to me like the problem is actually object orientation