refactor ad Controller and transform it to a service