using jquery and underscore because why not.. refactoring a bit