Refactor intervals