Refactored panda-cal