remove most of the smart pointer, will need to find something
more elegant