refactor of Edge and Path classes