cleanup and javadoc