Refactored out code for creating control panels in AppDelegate, out to a factory class.