major refactoring for quick_edit (part 2)