refactored code and extraced xml analyzer
removed unused function calls