Replace switch with flatMapLatest