refactored, using backbone.js