move some functionality to service