kernel-clear: optimize flow and output