2 of 5 General cleanup

# How to extract the element in the middle position of a list?

Here is one sample code, seems a little too long:

extract[x_] :=
Part[x, If[IntegerQ[#], {#}, {Floor[#], Ceiling[#]}]& @ Median[Range[Length@x]]]


Here is another, shorter, but for an even list, it only gives one value, not two. I think two values would be better for even list.

extract[x_] := Part[x, Quantile[Range[Length@x], 1/2]]


So is there concise, efficient code that will return two elements for a list of even length?