Removing debug code.
Renaming "activated" to "expanded" and simplifying it a bit.