optimize config&routing