Minor Code Quality/Optimization improvement

Deleting captions threw errors and I reduced the amount of times get was
called for the resource arrays. Also passed only the resource instead of
some unnecessary information in the delete function.