TGG interpreter: restructuring