simplify complex calculations