Refactor load plugin