Refactored and comments.