some cleanup and javadoc