refactoring of Edge