enhance navigation function and more unit tests