Handle different mode for the router