refactor html for ajax loaded content