factor interaction code out of surlamobi.js