getting the service out of the foreach
arrange configurations