rewrite to scale down router