refactor service instance