cleanup and javadocs