port to spin.js