finishing refactoring of Vertex and Edge classes