Second round of Javadoc writing + refactoring