Optimise header setup

The sections iterator neither needs to query twice just to get headerClass, nor needs to short twice.