I can make this DRY. It's actually being used to validate user input and not as a consistency check.