Working template with constructor