Refactorings and comments.
Merge.