eliminate unnecessary code from create document example