Multiple refactorings and multiedge bug fixes