(nit) this can be moved to the first line of the method for a small optimization.