Refactoring gridedit.