some refactoring in controllers_test.js