Added templates functionality