Feature/enviromental detection agency

NO MERGE - This needs to be tested