refactor fns to test-utils