better way of generating html code.