refactored xbmc scripts