Templates logic added