Refactor timeline handling.