add implementation of smart pointers and adapt code to them