refactor to use underscore each methd and improve documentation