html generation functionality