Addressed PR comments, squashed and rebased.