refactor Environment class