Optimised code for Chromecast