Merge "BUG-2006: Rework state tracking"