refactoring shop plugin