Load protection for toggle plugin, refactoring