Can handle more object types. refactored ref count