Updated service function