Refactor of all repositories and creation to test