Implementing the environment dynamics (unfinished). Refactor ala MVC