Refactor Env