js fileupload and refactor