Support for enums
Refactored checkUnconsumedAttributes