optimize various types of key scans so we don't pay for higher order
fn usage
formatting