javadoc and better exception handling