refactor navigation bar creation