Added support for environments