refactoring plug