Factor service stuff out.