It might be redundant to do this stuff here instead of higher up when iterating over each element. It probably doesn't matter a whole lot.