Make CC popup width dynamic
cleanup sysout, and some refactoring
Final touches to improve CC, #2758