Remove duplication in upload speed logic