Reorder HTML in order to display properly