Refactored html rendering and item/section creation