refactors upload_jami_rtf code