move document to model