refactored html generator, generate index.html