Added renumber options. Refactoring