deliver data from youtube; code refactoring