refactoring to use COR exception + structure validations