Use inheritance and simplify RedPipeItem
- Reuse code to manage reference counting allowing to more automatically manage these objects;
- Instead of using custom made function to manually release resource attempts to use more automatic memory management;