Can't you move the setting of `timeBehaviour` within the `if` block that follows?