Adding helper function to generate html