adding XML loader, some refactoring