interval.py refactorization and rename