Refactor Navigation functionality