clean up parser input args and create a state to store debug state.