improved section handling