Merge changes I52f70756,Icc621f0a

* changes:
  [NS A08] Tiny refactoring
  [NS A07] Move the last side effects out of the decision loop.