File refactoring and comments are added.