show_overflow code cleanup