Introduce html directive. Simplify rendering functions.