improve design of calculation