implementation of environment-ng (clos based)