Added more flexbility to customize routing.