refactored and finished plugin loading functionality