cosmetic clean ups + better html generation