reorganize cfg/automata
reorganize