Refactored the code for getting subtitles data