refactor to use initial env setup