Updated based on code review comments.