Refactor 'validate binary search tree' again.