refactor a bit
some fix for xsd compliance