Optimized that block code so that it checks and only calls draw range elements
once.