refactoring CalPanel