schema validation and a little cleanup