refactored plugin loading a bit more