Break down decoding and byte reading to separate modules