Refactor plugin structure.