Ditto for this function. Just use the attributes. Also the assertion logic can just go in the constructor.