Slight refactor of unit tests