refactor edit button