Slight refactoring of test