changed signatures for document loading