rather than this ternary if, can you create a function `navigateContextTo` (or something like that), which will handle it.