Updates in plugin after code review - full refactoring of publish action method