Fix env var bugs and better console reporting
extract settings to separate module