refactoring based on ad plugin generic interface