server refactor, plugin loading