refactor js to use backbone