refactoring gmm.xml creation and parsing