mod: code refactoring and variables renaming