move repository component from service to model