Improve quantum recipes code

quantum code clenaup