Small refactor in unit tests