Minor refactor on document item code