template in constructor