Attempt to optimize performance a bit.