CDB-2951 more threaded + some style cleaning