Making template pattern sample work