Implemented the repository pattern.