better handling of binary/non-binary files