machine: simplify plugin loader code