Updated controller class and tests.