cleaning up some validation code and encapsulating things with payload classes that support serialize methods