move automaton generator out