Refactor args->document translation