Minor refactoring of tests