Formalize document