Comments and some refactoring.