cot: maybe make cot stuff its own library?