refactor results to prevent duplicate html