add InstaceTemplate and some test