Code review, minor refactoring.