refactor movie sequence function