refactoring around Environment::AssignValue