Refactor service creation