Refactoring init repository in tests