Smart detection of environment. Cleaned up view config file