speed improvement by replacing call_user_func_array with a faster alternative