Removed useless import
Refactored the end of the EditEntity logic.