Simplify code in cpp and el, but introduce some bugs.

From now on, I will mainly work on cc_lookup.cpp due to the profiling
issues and the error handling.