Rename HTML files to index.html
Rewrite files moving code into multiple functions