Big cleanup of the code in the Controller classes