ROBE-218 refactoring and XML importer and tests fix