simplify processing of "DEF" command and persist state correctly
add a block for post processing upon command completion