Improved javadoc and logging