using the repository pattern