refactor Environtment.php