refactor
interval is working