refactor repositories does all the actions