refactor ad entity