more generic handling of html output