Changed code generation to be able to only generate common classes if needed.