improve exec method