Added intermediate step to allow for optimisation