Extract argument handling logic in pickBy