refactoring do intervalo