Better function to load plugins