refact service