document fragment optimization