refactored time window API