SleepChart refactored