Relocated endtime filtering to filter.py