Refactor base/length -> iterator pattern