redesign config structure and solve security issue