Starting to cleanup the code a bit.