Wrap the code inside main function for clarity.
Created attachment 245991 [details] Refactoring
Landed in r179583.