test helper refactored