Fix refactoring error in service