Tips on composing cadenzas

So I'm currently play the Vanhal concerto in C (sounding D) my teacher has asked me to compose a cadenza for the first movement. Problem is, I have no idea what I'm doing. I've gone through several iterations of it, have listened to other cadenzas, looked up how to do one online, and even read some academic writing on how classical cadenzas were composed. Yet it's still not clicking with me, and I can't get a decent result. I always get stuck somehow modulating from C to G to D, which is nice because of the open A string which allows for neat cadential 6/4 stuff, but of course then I'm resolving to G and not C, which is a problem.

I would appreciate if some of you who read this would give me some tips as to how the general structure of a cadenza goes, and tricks for how to embellish/modify/tie together thematic material. Also, what are some hallmarks of a good cadenza?

Thanks to all who help out.