refactor edit form