better use of underscore.js API for iterating over object