optimisation of the code which remove one division