initial refactor of the repository