TESTING: move some test helpers to reduce dependencies