passing directly smart pointer instead of its constant reference