Replace var env with environment