Refactorization of makeRange, debug type teller added