Refactor service