move array_extend to Misc class