Huge amount of cleaning up code and Javadoc.