added Document, moved dictionary to it