Refactor request and binary input reader.