refactored movies query