Cleanup the code a bit.