antoniop
committed
on 20 Nov 18
Unclutter the code by putting mode detection in a separate proc