refactor testFunctools