Refactor video management and fix #19