Minor changes for code refactoring and comments