Multiple instances: move module name creation into function and use it
Merge pull request #510 from LebedevRI/mi-label-functions

Multiple instances: move module name creation into function and use it