Using OpenStruct to simplify tree validation logic