Minor refactoring of unit tests