Very minor refactoring and more comments.