add duration information and clean up HTML markup