add query and something about template design model