Improve code that ensure panels are loaded only once.