Refactor Brightcove js