refactor with environmetn path