refactor: extract function set_objname
refactor: rename variable
operate in environment