Perhaps we can use `Math.min` here?