Code and javadoc cleanup