Refactored environment, but tests are broken, will fix soon.