Some basic improvements to looping structures