Refactoring controller.js : deferred