rework to use editor environment variable