Refactor Service provider