Generate HTML on separate thread