Comments, and some refactoring