Further code improvements after Scrutinizer check
Moved code for compatibility with other plugins on a separate class