Breaking up a large function - cosmetic change only.