docs(example): move common templates into lib
fix up type handling
docs(example): add in new type handling to template