Deleted code duplication in upper_bound