machine: simplify plugin loading code