minor refactoring of document map