Move re-usable sample code into a shared file