Removed remaining RefCounter classes and replaced them with smart pointers