Rethink edit logic