Cleanup the code some