consolidate encoding
implement more options