improve input verification and simplify text ident
improve input verification and simplify text ident