Refactoring after the introduction of XSL functions