a little refactoring for ad and ads_controllers