Made some of the code a little clearer.