Refactoring to WpPlugin