Refactor upload into its own class.