Some minor refactoring with new controller.js file and alerts removed