Refactor out common logic in __.min & __.max