add dijkstra & smaller refactorings
refactorings