Refactor min/max in lang_array