code cleaning/optimisation