Move some stuff from service into common