reduce code in object::cleanContent method