Update with apavlenko's suggestions.