Refactoring configure AutoPanel. Fix demo.