Refactoring plugin, extracting a new Detect class