Refactored and improved comments.