factor out the char stuff from binary stuff