Sleep refactor