Refactor
Allow attribute validation at class level.
Add some assertions.