Shared demo code between examples

high and dry