refactor ajax programHome