CodeGenerator modified to be usable for more components.