added common design pattern snippets