refactored routing and extracted xml file parsing stuff into new class