close #630 make convert function state <-> annotation