started refactoring of upload widget