separate labeling state machine from the rest of the code
format sections a bit more
expose cross reference ids