refactor env config