refactor the BalloonWindow class