Refactored for brevity