Move code from Html export to a Helper file