database refactoring and initial XML Schema validation