do some refactoring for show_info_box