minor refactoring of a unit test