Rework of smart pointer usage; partial logging update