long overdue refactoring of environment into separate files