Update code with regards to PR comments.