updated based on PR comments