Moved html generation into a separate module