simplify string handler, minor speedup