"Borrow" stuff from the JB xmbc plugin