minor refactoring of test