Adding field type and code cleanup for grabSections function