refactor code for adplugin load configuration