Read enviroment variables for config - and tidy up