make dijkstra class and refact test