optimize chooseSplitAxis