Refactoring and preparation for flv movies