Splitted up generate_HTML()