improve usage of smart pointer, fix memory leaks
visualize geometry in the table #3