minor refactor to make test code more readable