Javadoc and removing ugly code