Refactored for readability