Tidied code and added convenience methods to UploadFileCommand.