updated shared template code