refactored ccl.lib