Moved the environment into its own class