refactoring testing utilities