cleanup of some misused shared pointers