reduce duplicate calculate