The behavior switching framework