mild refactor for env port