some design changes, improvements in spotter.js