COSMIT: simplify code