shorten: introduce Ks only when it is needed more than once