cleaned up collector.js