made some more tweaks to leverage jquery and underscore