dist_srv reduced and refactored