Slight refactor of test