refactor ad and category manager