refactor dfa stuff