Updated mock generation logic.