auto play plugin refactoring