simplified func_dup