Generic validation and data conversion helpers