refactor delivieries function to use helper function that I'll use for deliveries count call.