Simplifying document code