Updated code to use service configuration