refactor edit