Implemented repository pattern.