Avoid call_user_func_array in query method