Update example assertion
Extract a few named functions for readability