added template query method