Improve routing behaviour and add some comments