factored out vertexes