fixup: deduplicate length decoding logic