Router impl similar to scala