Refactored away boilerplate validation