cyclic barrier and some cleanup