refactored code works except infobubbles