cot: code clean-up