Codegenerator overhaul