Minor refactoring to get model creation working. Update environment