Optimise DOM access