Put mirror_service into a function