refactor using require and backbone