Added support for auto detecting environment configurations