refactor - split out indiviual item html to it's own function