Enhanced stub generator.