Code refactoring and comments.