refactoring the entire plugin, adapted for calling of methods