Use conditions instead of assert.
Renamed methods from '_sanitize' to '_validate'.