Refactor submitApplication