adding repository pattern