Copy of store_template