Refactor service and manager