Updated according to PR comments