Add an option to disable NavigateTo feature

Also did various clean ups in the codebase.