refactored createChildren on panel