some refactoring to help with the compilation from ThingML