Localise a couple of variables for performance.