cleanup the code a little.