Refactored for code readability.