I like how you modularized this code and created the helper methods.  You correctly short circuit failing if validation fails.

The only thing I don't like  here is the context being in the global scope, as mentioned above.  Instead, you should pass the context as an argument to these helpers.