An example of some kind of validation pattern with injection