Major push in state machine cleanup