Smarter is_modified handling for UnitOfWork