cec: Simplify a few code snippets.