add message route and code optimization