Update Environment.java

Remove duplicate code.