Small refactoring in the DocumentHelper'