Reduced code duplication a bit in the unit test