add protobuf handler
refactor read handler
refactor header struct