We present a method for optimizing quantum circuits architecture, based on the notion of a quantum comb, which describes a circuit board where one can insert variable subcircuits. Unexplored quantum processing tasks, such as cloning and storing or retrieving of gates, can be optimized, along with setups for tomography and discrimination or estimation of quantum circuits.