More work on sequencer and code cleanup