Maybe use se `… map { case (xxxx, yyyy) => if (locaHandle.inbound) xxxx else yyyy }` to destructure the tuple, so you can give each entry a name?