simplify encoding