some minor cleaning up for the upload code.