Env detection works. Small refactor