Refactor. DPDA and DPDARulebook should be separated.