Further refactoring of unit tests