Detect online/offline + Refactoring