Generating proper output HTMLs