replace arg compilation with closure