Reorganised controller class.