Minor changes according the Dmitry's review notes (mainly variable renaming)