Modularizing Environment Processing

added environment processing to its own separate class, added interface
to go with it