Refactored to point-free style