refactor repositories_helper
better test coverage