Implement a more generic (and DRY) `iest` function