create html page for each dir
some refaction