minor improvements for switching modes