Allow for arbitrary number of environments