upload module refactor