Extract duplicate logic from bitmap deserializer classes