Clean up script to remove extraneous code