Move routing related codes to dispatcher from distributor