always execute writeTypeSystemEntitiesTo inside an environment