Refactor template and XSL paths into auto discovery. This can be further refactored.