changed html to template
added complete support of sub directories
optimized code
optimized code
optimized code