More refactoring and fixed uploads