initial refactor to incorporate ajax for file upload