Did some cleaning up of the code.