Neatened up some code.