final and tested version of env-loader