Refactor github js loadData into smaller functions