refactoring, seperate code for ad and motion