better Automaton

Change-Id: Id69fec08fd00874fadf20578ad2674ea24784133