We do the same thing for images. What do you think of making this a utility function to DRY things up and reduce LOC.