slightly better thought out smartpointer