html generation moved in a  object