speed up router function