general cleanup, and more javadoc