refactor with env helpers