finish refactor plugin