refactored getting plugins