decompose html report composition into functions