use shared_ptr
TODO: use references on variable references