Not that you're introducing the idea but do you know why we have ````== 2```` and ````== 3```` magic numbers here?  Do we not have proper macros for the values?  These will break if we do something as simple as re-order the modes.