Changed the Environment class to the Factory