TESTS: Refactor tests, to avoid duplicate code