Clean-up, plus an additional helper method for total dof.