error handling best practices

ok, why not to define `apply` here just as `validate(input)`?