refactor edit extraction