refactoring contentPanel