Code review changes by @nmdguerreiro