Minor tweak the code to make it more efficient.