Limit global calls, improve mode switching