Refactored upload into DCI - it works but too many dependencies to unit test