refactor ajax file upload javascript