Moving the renumbering code to externlib