only generate html when you need it