Major refactoring in functor_arrfunc