modulize navigation function.