Replaced remaining RefCounter with shared_ptr and removed them