Some refactoring of CommController.js