Ignore html files
Reorganize script into functions