refactorying custom navigation generator