moved creation of html info elements to seperate function