Changed router in order to use a dictionary