refactored time-panel and theme code