Refactoring unit tests