Move byte counting logic into Extractor