xslt refactoring and db changes