Refactor into proper standalone plugin project