Simple algebraic laws are applied to simplify the program, focusing especially on efficient imperative generation of HTML pages.