updating webapp upload UI and refactoring code