Updated with code review feedback.