Replaced remaining RefCounter classes with smart pointers and removed it