minor refactoring of unit test