Implement repository pattern