Adding TopPanel as an independent unit. Several optimizations.