js refactoring; backbone