removed a lot of duplicate code from VideoLibrary