Added some code to process action according to mode. With some logic statement. But no action yet. And statement sucks also. Need to better figure out what exact we get there.