Added ControllerTest
Refactored