Javadoc (not all i think but almost) and some changes in structure