better environment instance creation and initialization