Tech Debt: Refactor of ajax helper